Learn R Programming

Compositional (version 4.1)

Aithison's simple zero replacement strategy: Aithison's simple zero replacement strategy

Description

Aithison's simple zero replacement strategy.

Usage

zeroreplace(x, a = 2/3)

Arguments

x

A matrix with the compositional data.

a

The replacement value will be "a" times the minimum value observed in the compositional data.

Value

A matrix with the zero replaced compositional data.

Details

This is the simple zero replacement strategy suggested in Aitchison (1986, pg. 269).

References

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

perturbation, alfa

Examples

Run this code
# NOT RUN {
x <- as.matrix(iris[1:20, 1:4])
x <- x/ rowSums(x)
x[ sample(1:20, 4),  sample(1:4, 1) ] <- 0
zeroreplace(x)
# }

Run the code above in your browser using DataLab